package practice.com;

public class Assigment1 {

	public static void main(String[] args) {
		int[] array = {12,33,55,1,333,90,56};
          int sum = 0;       // sum of integer array elements
          for(int temp : array){
         sum+= temp;	
                               }
     System.out.println("the sum of given array elements is "+sum);


          for(int temp : array){   //displays the number which are greater than 20
                 if(temp > 20){

                System.out.println(+temp);
                     }
                   }
		// displays the array elements in ascending order
      for (int j = 0; j<array.length; j++) {
		        for (int k = 0; k < array.length; k++){
		            if (array[j] < array[k]) {
		                int buffer = array[j];
		                array[j] = array[k];
		                array[k] = buffer; 
		            }
			
		        }
			
		}
		            
		 for( int temp : array){
			 
			 System.out.println(temp);
		 }
	              

	

}}